import request from '@/utils/request'  
import cfg from '@/config/config'

const deviceManage = {

}


// 获取对应模块列表
deviceManage.getWtModuleList = (params) =>{
    return request('post', cfg.apiUrl + 'api/wtModule/getWtModuleList', params);
}
// 获取对应模块的功能列表
deviceManage.getTtdevList = (params) =>{
    return request('post', cfg.apiUrl + 'api/ttDev/getTtDev', params);
}
// 获取设备最大编号+1.
deviceManage.getMaxIdFromDevices = () =>{
    return request('post', cfg.apiUrl + 'api/stDevice/getMaxIdFromDevices');
}
// 保存设备.
deviceManage.saveDevice = (params) =>{
    return request('post', cfg.apiUrl + 'api/stDevice/saveDevice',params);
}
// 获取要修改的设备的信息.
deviceManage.getDeviceByBh = (params) =>{
    return request('post', cfg.apiUrl + 'api/stDevice/getDeviceByBh',params);
}
// 修改设备.
deviceManage.editDevice = (params) =>{
    return request('post', cfg.apiUrl + 'api/stDevice/editDevice',params);
}

// 删除设备.
deviceManage.deleteDevice = (params) =>{
    return request('post', cfg.apiUrl + 'api/stDevice/deleteDevice',params);
}


// 新增场所
deviceManage.getDevicePages = (params) =>{
    return request('post', cfg.apiUrl + 'api/stDevice/getDevicePages', params);
}

//新增场所前获取相关信息
deviceManage.getDataByAdd = (params) =>{
    return request('get', cfg.apiUrl + 'api/place/getDataByAdd', params);
}
// 新增场所
deviceManage.addPlace = (params) =>{
    return request('post', cfg.apiUrl + 'api/place/addPlace', params);
}
//修改场所前获取相关信息
deviceManage.getDataByRevise = (params) =>{
    return request('get', cfg.apiUrl + 'api/place/getDataByRevise', params);
}
// 修改场所
deviceManage.revisePlace = (params) =>{
    return request('post', cfg.apiUrl + 'api/place/revisePlace', params);
}
// 删除场所
deviceManage.removePlace = (params) =>{
    return request('post', cfg.apiUrl + 'api/place/removePlace', params);
}
// 检查场所是否具备可删除条件
deviceManage.checkPlace = (params) =>{
    return request('post', cfg.apiUrl + 'api/place/checkPlace', params);
}
export default deviceManage;

